﻿{include file="../application/admin/view/common/header.html" /}

<!--main content start-->
<section class="main-content">


    <!--start page content-->

    <div class="row">

        <div class="col-md-12">
            <div class="panel panel-default collapsed">
                <div class="panel-heading">
                    <div class="search-form">
                        <input type="text" class="form-control" id="input" placeholder="搜索专利号"/>
                        <button type="button" class="btn-search" id="submit"><i class="fa fa-search"></i></button>
                    </div>
                </div>
                <div class="panel-body">

                    <table class="table table-hover table-striped table-bordered" data-page-size="12"
                           data-filter=#filter>
                        <thead>
                        <tr>
                            <th>申请号</th>
                            <th>专利名称</th>
                            <th>所在领域</th>
                            <th>所在分类小分</th>
                            <th>总分</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>

                        </tbody>
                    </table>
                    <div class="pager" id="page" style="text-align: right;"></div>
                </div>
            </div>
        </div>
    </div><!--end row-->

    <!--end page content-->
</section>
<!--end main content-->


<!--Common plugins-->
<script src="_JS_/jquery.min.js"></script>
<script src="_JS_/jquery.base64.js"></script>
<script src="_JS_/jquery.cookie.js"></script>
<script src="_JS_/bootstrap.min.js"></script>
<script src="_JS_/jasny-bootstrap.min.js"></script>
<script src="_JS_/jquery.slimscroll.min.js"></script>
<script src="_JS_/jquery.nanoscroller.min.js"></script>
<script src="_JS_/metismenu.min.js"></script>
<script src="_JS_/float-custom.js"></script>
<script type="text/javascript" src="_JS_/layer/layer.js"></script>
<script type="text/javascript" src="_JS_/laypage/laypage.js"></script>
<script type="text/javascript" src="_JS_/laydata/laydate.js"></script>
<script type="text/javascript" src="_JS_/getMyDate.js"></script>
<!-- Page-Level Scripts -->
<script>
    $(function () {
        $("#page-title").html('专利评分');
        postfile(1);
    })


    function postfile(page) {
        var username = $('#input').val();
        $.ajax({
            type: 'GET',
            url: "{:url('api/Patent/manage')}",
            dataType: 'jsonp',
            jsonp: 'callback',
            data: {
                'page': page,
                'name': username,
            },
            beforeSend: function () {
                var index = layer.load(1, {
                    shade: [0.1, '#333333'] //0.1透明度的白色背景
                });
            },
            success: function (msg) {
                $("#patent").addClass("active").children("ul").addClass("in");
                $("#patent_manage").addClass("choose");
                layer.closeAll();
                if (msg.code == 200) {
                    var pages = Math.ceil(msg.data.count / 10);
                    $(".table tbody").html('');
                    var html = '';
                    if (msg.data.data.length > 0) {
                        for (var i = 0; i < msg.data.data.length; i++) {
                            html += '<tr><td>' + msg.data.data[i].order + '</td><td>' + msg.data.data[i].title + '</td>' +
                                '<td>' + msg.data.data[i].type + '</td><td>' + msg.data.data[i].small_score + '</td><td class="enable">' + msg.data.data[i].total_score + '</td>' +
                                '<td class="buttons td-manage"><a class="btn table-btn" onclick="patent_msg(' + msg.data.data[i].id + ')" href="#" title="查看详情">' +
                                '<i class="fa fa-ellipsis-h"></i></a></td></tr>';
                        }
                    }
                    $(".table tbody").html(html);
                    //分页
                    $(".table").attr("pages", page);
                    laypage({
                        cont: 'page',
                        pages: pages,
                        curr: page,
                        jump: function (obj, first) {
                            if (!first) { //点击跳页触发函数自身，并传递当前页：obj.curr
                                postfile(obj.curr);
                            }
                        }
                    })
                } else {
                    layer.msg('获取信息不成功!', {icon: 5, time: 2000});
                }
            }
        })
    }

    $('#submit').click(function () {
        postfile(1);
    })

    //回车键绑定搜索
    $(".search-form").keydown(function (event) {
        if (event.keyCode == 13) {
            postfile(1);
        }
    });

    //用户信息
    function patent_msg(id) {
        layer.open({
            type: 2,
            title: '用户信息',
            shadeClose: true,
            shade: 0.8,
            area: ['700px', '250px'],
            content: 'manage_msg.html#' + id
        });
    }


</script>
</body>
</html>